/*
 * Copyright (c)  2016, dabing.io
 * All rights reserved.
 * FavoritesEntity.java 2017-09-16 上午8:48
 */

package com.ueboot.weishop.entity.customer;

import com.ueboot.weishop.entity.IDEntity;
import com.ueboot.weishop.entity.goods.GoodsInfoEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * 描述:客户收藏的商品信息
 *
 * @author yangkui create on 2017-09-16.
 * @since 1.0
 */
@Data
@NoArgsConstructor
@Entity(name = "WS_CUS_FAVORITES")
public class CustomerFavoritesEntity extends IDEntity {
    @Id
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "WS_CUS_FAVORITES")
    @GenericGenerator(name = "WS_CUS_FAVORITES", strategy = "enhanced-table", parameters = {
            @org.hibernate.annotations.Parameter(name = "table_name", value = "WS_TABLE_SEQUENCE"),
            @org.hibernate.annotations.Parameter(name = "segment_value", value = "WS_CUS_FAVORITES"),
            @org.hibernate.annotations.Parameter(name = "optimizer", value = "pooled")})
    @Column(name = "ID", columnDefinition = "INT(20) COMMENT 'id主键'", length = 20)
    private Long id;
    /**
     * 收藏的商品
     */
    @ManyToOne
    @JoinColumn(name="GOODS_INFO_ID",columnDefinition = "INT(20) COMMENT '收藏的商品'")
    private GoodsInfoEntity goodsInfo;

    /**
     * 所属客户
     */
    @ManyToOne
    @JoinColumn(name="CUSTOMER_ID",columnDefinition = "INT(20) COMMENT '所属客户'")
    private CustomerInfoEntity customer;

}